package cn.signalpha.modules.base.wrapper;

import cn.signalpha.core.mp.support.BaseEntityWrapper;
import cn.signalpha.core.tool.utils.BeanUtil;
import cn.signalpha.modules.base.entity.WxReplyRule;
import cn.signalpha.modules.base.vo.WxReplyRuleVO;
import java.util.Objects;

/**
 * 包装类,返回视图层所需的字段
 *
 * @author signalpha
 */
public class WxReplyRuleWrapper extends BaseEntityWrapper<WxReplyRule, WxReplyRuleVO>  {

	public static WxReplyRuleWrapper build() {
		return new WxReplyRuleWrapper();
 	}

	@Override
	public WxReplyRuleVO entityVO(WxReplyRule wxReplyRule) {
		WxReplyRuleVO wxReplyRuleVO = Objects.requireNonNull(BeanUtil.copy(wxReplyRule, WxReplyRuleVO.class));

		//User createUser = UserCache.getUser(wxReplyRule.getCreateUser());
		//User updateUser = UserCache.getUser(wxReplyRule.getUpdateUser());
		//wxReplyRuleVO.setCreateUserName(createUser.getName());
		//wxReplyRuleVO.setUpdateUserName(updateUser.getName());

		return wxReplyRuleVO;
	}

}
